<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS3动态背景登录框代码</title>

<link rel="stylesheet" type="text/css" href="css/styles1.css">
<style type="text/css">
body,td,th { font-family: "Source Sans Pro", sans-serif; }
body { background-color: #74c6ab; }
</style>
<script type="text/javascript">  
    function submitForm(){  
        //得到你的from
var form = document.forms['upfile'];
//在这里手工指定提交给哪个ACTION
form.action = 'register';
//执行SUBMIT
form.submit();
    }  
</script> 
</head>
<body>


<div class="wrapper">

	<div class="container">
		<h1>欢迎注册</h1>
		<%
			String state = (String)request.getParameter("state");
			if(state.equals("2")){
				String error1 = (String)request.getAttribute("error1");
				String error2 = (String)request.getAttribute("error2");
				String warning1 = (String)request.getAttribute("warning1");
				String warning2 = (String)request.getAttribute("warning2");
				out.print("<font color='red'>"+request.getAttribute("error1")+"</font></br>");
				out.print("<font color='red'>"+request.getAttribute("error2")+"</font></br>");
				out.print("<font color='red'>"+request.getAttribute("warning1")+"</font></br>");
				out.print("<font color='red'>"+request.getAttribute("warning2")+"</font></br>");
			}
		%>
		 <form class="form" action="register?state=register" method="post"><!-- enctype="multipart/form-data" -->
        <table>
			<tr><td>请选择注册类型:</td><td><select name='type'><option value="1">个人用户</option><option value='2'>企业用户</option></td></tr>
			<tr><td>用户名:</td><td><input type="text" name="username" placeholder="请输入用户名"/></td></tr>
			<tr><td>密码:</td><td><input type="password" name="password1" id="password1" placeholder="请输入密码"/></td></tr>
			<tr><td>确认密码:</td><td><input type="password" name="password2" id="password2" placeholder="请确认密码"/></td></tr>
			<tr><td>密码提示问题:</td><td><input type="text" name="question" placeholder="请输入问题"/></td></tr>
			<tr><td>答案:</td><td><input type="text" name="answer" placeholder="请输入答案"/></td></tr>
			<tr><td>安全码:</td><td><input type="text" name="safecode1" placeholder="请确认安全码"/></td></tr>
			<tr><td>确认安全码:</td><td><input type="text" name="safecode2" placeholder="请确认安全码"></td></tr>
			<!--  <tr><td>头像地址:</td><td><input type="file" name="file" placeholder="请上传图片" /></td></tr> -->
			<tr><td>电子邮件:</td><td><input type="text" name="email" placeholder="请输入电子邮件"/></td></tr>			 
			<tr><td><input type="submit" value="保存" onclick="submitForm()"/></td><td><input type="reset" value="重置"/></td></tr>
        </table>
            </form>
	</div>
	
	<ul class="bg-bubbles">
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
	</ul>
	
</div>

<script type="text/javascript" src="js/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
$('#login-button').click(function(event){
	event.preventDefault();
	$('form').fadeOut(500);
	$('.wrapper').addClass('form-success');
});
</script>

</body>
</html>